<!---
	TEMPLATE: index.cfm
	AUTHOR: Matt Woodward (mpwoodward@gmail.com)
	DATE: 2/21/2005
	PURPOSE: Basic data list for sample Hibernate app in CF
	CHANGE HISTORY:
		* 2/21/2005: template created (Matt Woodward)
--->

<!--- get the user data from the database --->
<cfquery name="getUsers" datasource="#Application.DSN#">
	SELECT * 
	FROM users 
	ORDER BY last_name, first_name, email ASC
</cfquery>

<html>
	<head>
		<title>CFHibernate Testing App</title>
	</head>
	<body>
		<h3>CFHibernate Testing App</h3>
		
		<table border="0" width="500" cellpadding="2" cellspacing="1"
			bgcolor="#999999">
			<cfif getUsers.RecordCount GT 0>
				<tr bgcolor="#dedede">
					<th>Last Name</th>
					<th>First Name</th>
					<th>E-Mail</th>
					<th>Edit</th>
				</tr>
				<cfoutput query="getUsers">
					<tr bgcolor="##ffffff">
						<td>#last_name#</td>
						<td>#first_name#</td>
						<td>#email#</td>
						<td>
							<a href="userForm.cfm?action=Update&id=#userID#">
								Edit
							</a>
						</td>
					</tr>
				</cfoutput>
			</cfif>
		</table><br />
		<ul>
			<li><a href="userForm.cfm?action=Add">Add a New User</a></li>
		</ul>
	</body>
</html>
